using System;
using System.Data;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for DetailsViewHelper
/// </summary>
public partial class ControlHelper
{
    public void FillDataTableToDetailsView(
    DetailsView detailsView)
    {


        DataTable dataTable =
        sqlServerProvider.GetDataTable();
        if (dataTable != null)
        {
            detailsView.DataSource = dataTable;
        }
        else
            detailsView.DataSource = null;
        detailsView.DataBind();
    }
    
    public void FillDataTableToDetailsView(
    DetailsView detailsView, 
    int pageCount, 
    PagerButtons pagerButtons)
    {

        detailsView.AllowPaging=true;
        DataTable dataTable =
        sqlServerProvider.GetDataTable();
        if (dataTable != null)
        {
            detailsView.DataSource = dataTable;           
            detailsView.PagerSettings.PageButtonCount = pageCount;
            detailsView.PagerSettings.Mode = pagerButtons;
        }
        else
            detailsView.DataSource = null;
        detailsView.DataBind();
    }
}
